package com.star.eastern.blee.customview;

import android.content.Context;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.star.eastern.blee.R;

public class DeviceViewItem extends LinearLayout {

    private TextView tvSignalText;
    private TextView tvDeviceName;
    private Button btnConnectBtn;


    public DeviceViewItem(Context context) {
        super(context, null);
    }
    public DeviceViewItem(Context context, AttributeSet attrs) {
        super(context, attrs);

        LayoutInflater inflater = (LayoutInflater) context
                .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        inflater.inflate(R.layout.deviceitemview, this, true);
        tvSignalText = this.findViewById(R.id.deviceitem_signalsize);
        tvDeviceName = this.findViewById(R.id.deviceitem_devicename);
        btnConnectBtn = this.findViewById(R.id.deviceitem_connectbtn);
    }

    public void setSignalText(String text)
    {
        this.tvSignalText.setText("");
    }
    public void setDeviceName(String text)
    {
        this.tvDeviceName.setText(text);
    }
    public void setSignalTextBackground(Drawable draw)
    {
        tvSignalText.setBackground(draw);
    }

}
